<?php
/**
* 
*/
class Mkegiatan extends CI_Model
{
	
	function ambil()
	{
		$ambil = $this->db->get('kegiatan');
		if($ambil->num_rows()>0) {
			foreach ($ambil->result()as $data) {
				$hasil[] = $data;
			}
			return $hasil;
	}

	function tambah(){
		$nama = $this->input->post('nama');
		$deskripsi = $this->input->post('deskripsi');
		$data = array(
			'nama' => $nama,
			'deskripsi' => $deskripsi
			);
		$this->db->insert('kegiatan',$data);
	}

	function hapus($id){
		$this->db->delete('kegiatan',array('idkegiatan'=>$id));
	}
}

?>